 }
 
 /// Extension to the standard library Dictionary that makes it easier to work with nested collections
-public extension Dictionary where Value: MutableIndexedCollectionType, Value: EmptyInitializable, Value.Generator.Element: Equatable {
+public extension Dictionary where Value: MutableIndexedCollectionType, Value: EmptyInitializable {
     /// Insert a value into a nested collection
     public mutating func insertValue(value: Value.Generator.Element, intoCollectionForKey key: Key) {
         var collection = self[key] ?? Value()

        self[key] = collection
    }
    
    /// Remove a value from a nested collection
    public mutating func removeValue(value: Value.Generator.Element, atIndex index: Value.Index? = nil, fromCollectionForKey key: Key) {
        guard var collection = self[key] else {
            return
        }
        
        guard let index = index ?? self[key]?.indexOf(value) else {
            return
        }
        

        self[key] = collection
    }
}

/// Convenience APIs for nested mutable indexed collections where the values are equatable
public extension Dictionary where Value: MutableIndexedCollectionType, Value.Generator.Element: Equatable {
    /// Remove a value from a nested collection by finding it
    public mutating func removeValue(value: Value.Generator.Element, fromCollectionForKey key: Key) {
        guard var collection = self[key] else {
            return
        }
        
        guard let index = collection.indexOf(value) else {
            return
        }
        
        collection.removeAtIndex(index)
        self[key] = collection
    }
}
