paging refactor