full iteration everywhere
another general refactoring