refactoring for usage with pagekit