         }
     }
     
-    private class func autoMigrateStoreOptions() -> [NSObject: AnyObject] {
+    /**
+    Returns the automigration options to be used when the NSPersistentStore is initialized
+    
+    :returns: [NSObject: AnyObject] with the options
+    */
+    private class func autoMigrateStoreOptions() -> [NSObject: AnyObject]
+    {
         var sqliteOptions: [String: String] = [String: String] ()
         sqliteOptions["WAL"] = "journal_mode"
         var options: [NSObject: AnyObject] = [NSObject: AnyObject] ()

        return sqliteOptions
    }
    
    private class func defaultStoreOptions() -> [NSObject: AnyObject] {
        var sqliteOptions: [String: String] = [String: String] ()
        sqliteOptions["WAL"] = "journal_mode"
        var options: [NSObject: AnyObject] = [NSObject: AnyObject] ()

        return SugarRecordCDContext(context: self.mainContext!)
    }
    
    /**
    Removes the local database
    */
    public func removeDatabase()
    {
        var error: NSError?
        if databasePath == nil {
            SugarRecord.handle(NSException(name: "CoreData database deletion error", reason: "Couldn't delete the database because the path was nil", userInfo: nil))
            return
        }
        NSFileManager.defaultManager().removeItemAtURL(databasePath!, error: &error)
        SugarRecord.handle(error)
    }
    
    
    //MARK - Creation helper
    
    /**
    Creates the main stack context
    
    :param: parentContext NSManagedObjectContext to be set as the parent of the main context
    
    :returns: Main NSManageObjectContext
    */
    private func createMainContext(parentContext: NSManagedObjectContext?) -> NSManagedObjectContext
    {
        var context: NSManagedObjectContext?
        if parentContext == nil {
            SugarRecord.handle(NSError(domain: "The root saving context is not initialized", code: SugarRecordErrorCodes.CoreDataError.toRaw(), userInfo: nil))
        }
        context = NSManagedObjectContext(concurrencyType: .MainQueueConcurrencyType)
        context!.parentContext = parentContext!
        context!.addObserverToGetPermanentIDsBeforeSaving()
        context!.name = "Main context"
        SugarRecordLogger.logLevelVerbose.log("Created MAIN context")
        return context!
    }
    
    /**
    Creates a temporary root saving context to be used in background operations
    
    :param: persistentStoreCoordinator NSPersistentStoreCoordinator to be set as the persistent store coordinator of the created context
    
    :returns: Private NSManageObjectContext
    */
    private func createRootSavingContext(persistentStoreCoordinator: NSPersistentStoreCoordinator?) -> NSManagedObjectContext
    {
        var context: NSManagedObjectContext?
        if persistentStoreCoordinator == nil {
            SugarRecord.handle(NSError(domain: "The persistent store coordinator is not initialized", code: SugarRecordErrorCodes.CoreDataError.toRaw(), userInfo: nil))
        }
        context = NSManagedObjectContext(concurrencyType: .PrivateQueueConcurrencyType)
        context!.persistentStoreCoordinator = persistentStoreCoordinator!
        context!.addObserverToGetPermanentIDsBeforeSaving()
        context!.name = "Root saving context"
        SugarRecordLogger.logLevelVerbose.log("Created MAIN context")
        return context!
    }
    
    /**
    Creates the stack's persistent store coordinator
    
    :returns: NSPersistentStoreCoordinator of the stack
    */
    private func createPersistentStoreCoordinator() -> NSPersistentStoreCoordinator
    {
        var model: NSManagedObjectModel = NSManagedObjectModel.mergedModelFromBundles(nil)
