Refactor the StaticPages controller