Refactored page stuff to restricted page