AppController refactoring