refactoring iterators, filling traverse