Pagination entirely after refactoring