refactor parse_options()