lots of refactors, starting on interation section