Refactor iterators and Locate methods.