Comment and simplify parse_function