cleaned up the pagecontroller