I inherited some code and I\'m having issues refactoring. The script can successfully paginate data from a get request, as well as run a search query and paginate the result