Improve default pagination implementation.