   # Private methods
   #####################################
 
-  processPacketHelper = (packet, collection) ->
-    local_collection = @collections[collection || packet.collection]
-    index = null
-    record = null
-
-    index = _.findIndex(local_collection, (record) -> record.id == packet.id)
-    if (index >= 0)
-      record = local_collection[index]
-
-    return {
-      collection: local_collection
-      index: index
-      record: record
-    }
-
   # Default callbacks for internal storage of received packets
   # Need to set include_initial: true in broadcasting options
-  default_callbacks =
+  class DefaultCallbacks
+    constructor: (@collections) ->
+
+    # Helper function
+    processPacketHelper = (packet, collection) ->
+      index = -1
+      record = null
+
+      local_collection = @collections[collection || packet.collection]
+      if !local_collection
+        console.warn("[update_many]: Collection #{collection_name} doesn't exist")
+      else
+        index = _.find(local_collection, (record) -> record.id == packet.id)
+        if (index >= 0)
+          record = local_collection[index]
+
+      return {
+        collection: local_collection
+        index: index
+        record: record
+      }
+
+    # Callbacks
+    ##################################################
+
     initialize: (collection) ->
       @collections[collection] = []
-
-    collection_add: (packet, collection) ->
-      local_collection = @collections[collection || packet.collection]
-      _.each packet.data, (fields) ->
-        record = _.findIndex(local_collection, (r) -> r.id == fields.id)
-        if record>=0
-          _.extend(local_collection[record], fields)
-        else
-          local_collection.push(fields)
 
     collection_remove: (packet, collection) ->
       console.warn 'Method not implemented: collection_remove '

      @collections[collection].push record
    record


# Export to global namespace
#######################################
@App = {} unless @App

        _.extend(data.record, packet.data)

    update_many: (packet, collection) ->
      collection_name = collection || packet.collection
      local_collection = @collections[collection_name]
      if !local_collection
        console.warn("[update_many]: Collection #{collection_name} doesn't exist")
      else
        _.each packet.data, (fields) ->
          record = _.findIndex(local_collection, (r) -> r.id == fields.id)
          if record>=0
            _.extend(local_collection[record], fields)
          else
            local_collection.push(fields)

    destroy: (packet, collection) ->
      data = processPacketHelper(packet, collection)
