adding new pages and refactoring