Refactor StaticPages controller