Improving the pagination