Improved how pagination is handled