Extract type parameter finder code to a utility class