improve with early return statement
rename func_ref_type to generic_func_type