refactor test_iteration