some refactoring, appedned ref to iterations context