Another attempt to fix issues with generics