Refactoring some search functionality - adding hooks for paging