Change some implementation details and add iterator input