iterator refactored