Refactoring iterators

Change-Id: Ib70dbcab38c98b3bd81ab9fff27890df25508f0c