paginator refactoring