code cleanup for AppController