refactored page_controller