iterator refactor