pages_controller - 20 examples 92.81%

1. All examples passed.
2. Slight modification to pages_controller to make the code more readiable