Cleaned up the iterators

Cleaned up the iterators a bit and got rid of redundant code.