Used a fancy wrapper to attempt to optimize pagination