Use a generic method rather than taking a type parameter.