Improved the generics assignment