Refactor to use application search rather than a set number of accounts etc.