Small extract method to change deserialization types in generics