Refactor iterators