refactor of pages