paging refactoring