refactoring how to page