AppController: Code refactor.