     ///
     /// Calls a function any time this value is marked as changed
     ///
-    public final func whenChanged(action: Notifiable) -> Lifetime {
+    public final func whenChanged(target: Notifiable) -> Lifetime {
         // Record this action so we can re-run it when the value changes
-        let thisActionId = _nextActionId;
-        _nextActionId += 1;
-        _actionsOnChanged.append((thisActionId, action));
+        let wrapper = NotificationWrapper(target: target);
+        _actionsOnChanged.append(wrapper);
         
         // Stop observing the action once the lifetime expires
         return CallbackLifetime(done: {
-            let index = self._actionsOnChanged.indexOf({ (id, _) in return id == thisActionId; });
-            if let index = index {
-                self._actionsOnChanged.removeAtIndex(index);
-            }
+            wrapper.target = nil;
         });
     }
 

    ///
    /// Calls a function any time this value is marked as changed
    ///
    func whenChanged(what: Notifiable) -> Lifetime;
}

///

    /// Causes any observers to be notified that this object has changed
    ///
    internal final func notifyChange() {
        var needToTidy = false;
        
        // Run any actions that result from this value being updated
        for notificationWrapper in _actionsOnChanged {
            if let action = notificationWrapper.target {
                action.markAsChanged();
            } else {
                needToTidy = true;
            }
        }
        
        if needToTidy {
            _actionsOnChanged = _actionsOnChanged.filter { notificationWrapper in
                return notificationWrapper.target != nil
            };
            
            
        }
    }
    
