Refactor AppCtrl