Added copy_func_return_type to dedup some code.