   unshift: (item) -> @insertAt(0, item)
   shift: -> @deleteAt(0)
   update: (list) ->
-    @_notIn(element) for element in @
+    unmark(@, element) for element in @
     delete @[index] for index, _ of @ when isArrayIndex(index)
     @[index] = val for val, index in list
-    @_in(element) for element in list
+    mark(@, element) for element in list
     @trigger("update", list)
     @trigger("change", @)
     list
   splice: (start, deleteCount, list...) ->
-    @_in(element) for item in list
+    mark(@, element) for item in list
     deleted = Array.prototype.splice.apply(@, [start, deleteCount, list...])
-    @_notIn(element) for element in deleted
+    unmark(@, element) for element in deleted
     @trigger("update", list)
     @trigger("change", @)
     new Collection(deleted)

    array[index] = val for index, val of @ when isArrayIndex(index)
    array

  _in: (item) ->
    if item?._useDefer
      item._inCollections or= {}
      item._inCollections[this] = this

  _notIn: (item) ->
    delete item._inCollections[this] if item?._inCollections

  _useDefer: true

  find: (fun) ->
    return item for item in @ when fun(item)
  insertAt: (index, value) ->
    mark(@, value)
    Array.prototype.splice.call(@, index, 0, value)
    @trigger("insert", index, value)
    @trigger("change", @)
    value
  deleteAt: (index) ->
    value = @[index]
    unmark(@, value)
    Array.prototype.splice.call(@, index, 1)
    @trigger("delete", index, value)
    @trigger("change", @)
