separate out parse_options method