refactoring iterators