refactoring to make it easier to do view iteration directly