Modified to remove warning for generic type