optimize iterators