simplify return_type calculation