Cleanup iterator

Use box around sub-iterators instead of custom enum.
Use map where possible for options.