         if TARGET_OS_SIMULATOR != 0 || TARGET_IPHONE_SIMULATOR != 0 {
             print("Realm path: \(Realm.Configuration.defaultConfiguration.fileURL!)")
             // Catches all exceptions and prints
-            NSSetUncaughtExceptionHandler { (exception) in
-                print(exception)
-            }
-
+            NSSetUncaughtExceptionHandler { print($0) }
             // For UITesting, handle any launch options
-            prepareForUITesting()
-        }
-
+            self.prepareForUITesting()
+        }
         return true
     }
     

    }

    /// Handles opening app via 3D touch quick action
    func application(_ application: UIApplication, performActionFor shortcutItem: UIApplicationShortcutItem,
                     completionHandler: @escaping (Bool) -> Void)
    {
        switch shortcutItem.quickActionId {
        case .addNewClass:
            guard let splitNav = window?.rootViewController?.childViewControllers.first?.childViewControllers.first,

        // Figure out whether we have onboarded the user or not
        let hasOnboarded = defaults.bool(forKey: userDefaultOnboardingComplete)

        // TODO: Remove this code whenever old user base is migrated to version 2.0
        // Code in here due to the new re-ordering of default terms and there locations in version 2.0.
        if let terms = defaults.stringArray(forKey: userDefaultTerms), terms.count == 4 && terms[0] == "Spring" &&
            terms[1] == "Summer" && terms[2] == "Fall" && terms[3] == "Winter"
        {
            defaults.set(["Winter", "Fall", "Summer", "Spring"], forKey: userDefaultTerms)
        }
        
        // Present onboarding if neccessary
        if !hasOnboarded { self.presentOnboarding() }
        
        // Perform any required database migrations
        DatabaseManager.setupRealm() {
            // App has launched and migrations finished, increase sessions
            self.incrementSessions()
