restructure buggy parse_args routine