refactoring to make it easier to do view iteration directly
Merge pull request #940 from dimagi/ptop-fast-cleanup

refactoring to make it easier to do view iteration directly