     }
     
     public func application(application: UIApplication, performFetchWithCompletionHandler completionHandler: (UIBackgroundFetchResult) -> Void) {
-        if dataManager == nil {
-            createDataManager()
-        }
-        
-        let originalList: [NSManagedObjectID] = (dataManager!.feeds().reduce([], combine: {return $0 + ($1.articles.allObjects as [Article])}) as [Article]).map { return $0.objectID }
+        let originalList: [NSManagedObjectID] = (dataManager.feeds().reduce([], combine: {return $0 + ($1.articles.allObjects as [Article])}) as [Article]).map { return $0.objectID }
         if originalList.count == 0 {
             completionHandler(.Failed)
             return
         }
-        dataManager!.updateFeedsInBackground({(error: NSError?) in
+        dataManager.updateFeedsInBackground({(error: NSError?) in
             if (error != nil) {
                 completionHandler(.Failed)
                 return
             }
-            let al : [NSManagedObjectID] = (self.dataManager!.feeds().reduce([], combine: {return $0 + ($1.articles.allObjects as [Article])}) as [Article]).map { return $0.objectID }
+            let al : [NSManagedObjectID] = (self.dataManager.feeds().reduce([], combine: {return $0 + ($1.articles.allObjects as [Article])}) as [Article]).map { return $0.objectID }
             if (al.count == originalList.count) {
                 completionHandler(.NoData)
                 return


    public var collapseDetailViewController = true
    
    var dataManager : DataManager? = nil
    
    public func createDataManager() {
        dataManager = DataManager()
    }

    public func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
        self.window?.backgroundColor = UIColor.whiteColor()
        self.window?.makeKeyAndVisible()
        
        if dataManager == nil {
            createDataManager()
        }
        
        UINavigationBar.appearance().tintColor = UIColor.darkGreenColor()
        UIBarButtonItem.appearance().tintColor = UIColor.darkGreenColor()

    public func applicationDidEnterBackground(application: UIApplication) {
        // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
        // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
        dataManager.managedObjectContext.save(nil)
    }

    public func applicationWillEnterForeground(application: UIApplication) {
