add and use each() helper to remove iterations with iterators