     
     var identifier: (key: String, value: String)
     
-    weak var delegate: PrivateManagedObjectObserverDelegate?
+    weak var delegate: PrivateEntityControllerDelegate?
+    
+    var enabled: Bool = false {
+        
+        willSet {
+            
+            // only new values
+            guard enabled != newValue else { return }
+            
+            if newValue {
+                
+                NSNotificationCenter.defaultCenter().addObserver(self, selector: "objectsDidChange:", name: NSManagedObjectContextObjectsDidChangeNotification, object: context)
+            }
+            else {
+                
+                NSNotificationCenter.defaultCenter().removeObserver(self, name: NSManagedObjectContextObjectsDidChangeNotification, object: self.context)
+            }
+        }
+    }
     
     deinit {
         
-        NSNotificationCenter.defaultCenter().removeObserver(self, name: NSManagedObjectContextObjectsDidChangeNotification, object: self.context)
+        enabled = false
     }
     
     init(entityName: String, identifier: (key: String, value: String), context: NSManagedObjectContext) {

        self.entityName = entityName
        self.identifier = identifier
        self.context = context
        
        super.init()
        
        NSNotificationCenter.defaultCenter().addObserver(self, selector: "managedObjectContextObjectsDidChange:", name: NSManagedObjectContextObjectsDidChangeNotification, object: context)
    }
    
    @objc func managedObjectContextObjectsDidChange(notification: NSNotification) {
        
        if let updatedObjects = notification.userInfo?[NSUpdatedObjectsKey] as! [NSManagedObject]? {
            
            for managedObject in updatedObjects {
                
                if managedObject.valueForKey(identifier.key) as? NSObject == identifier.value {
                    
                    self.delegate?.observer(self, managedObjectUpdated: managedObject)
                    
                    return
                }
            }
        }
        
        if let deletedObjects = notification.userInfo?[NSDeletedObjectsKey] as! [NSManagedObject]? {
            
            for managedObject in deletedObjects {
                
                if managedObject.valueForKey(identifier.key) as? NSObject == identifier.value {
                    
                    self.delegate?.observer(self, managedObjectDeleted: managedObject)
                    
                    return
                }
            }
        }
    }
}

private protocol PrivateManagedObjectObserverDelegate: class {
    
    func observer(observer: PrivateEntityController, managedObjectUpdated managedObject: NSManagedObject)
    
    func observer(observer: PrivateEntityController, managedObjectDeleted managedObject: NSManagedObject)
}

extension EntityController: PrivateManagedObjectObserverDelegate {
    
    private func observer(observer: PrivateEntityController, managedObjectUpdated managedObject: NSManagedObject) {
        
        let decodable = Decodable.init(managedObject: managedObject)
        
        self.event.updated(decodable)
    }

    }
    
    public var event = ManagedObjectObserverEvent<Decodable>()
    
    public var enabled: Bool {
        
        get { return self.privateController.enabled }
        
        set { self.privateController.delegate = self; self.privateController.enabled = newValue }
    }
    
    // MARK: - Private Properties
    
