Moves iteration logic into Transform