huge cleanup and refactor of pages and flyout