first iteration with generics