finished refactoring paginator

please have a check.