Improve iterators in for loops