refactor parse_tuple