refactor parse_arg