Small refactoring to generics, Iterator implement