Refactored iterator stuff
Cleaned up iterator definition