First version of the implementation with the generics.