More work on AppDelegate.