refactor iterators