       opts = $.extend {}, options, include: include, success: (firstLayerCollection) =>
         @_success(options, collection, firstLayerCollection)
 
-      cl = new Brainstem.CollectionLoader(storageManager: @storageManager, successFunction: @_success)
+      cl = new Brainstem.CollectionLoader(storageManager: @storageManager)
       cl.loadCollection(opts)
 
       # @_loadCollectionWithFirstLayer($.extend({}, options, include: include, success: ((firstLayerCollection) =>

class Brainstem.CollectionLoader
  constructor: (options = {}) ->
    @storageManager = options.storageManager
    @successFunction = options.successFunction

  _parseLoadOptions: (loadOptions) ->
    @loadOptions = $.extend {}, loadOptions

    syncOptions.data.search = @loadOptions.search if @loadOptions.search
    syncOptions

  _success: (options, collection, data) ->
    if data
      data = data.models if data.models?
      collection.setLoaded true, trigger: false
      if collection.length
        collection.add data
      else
        collection.reset data
    collection.setLoaded true
    options.success(collection) if options.success?

####################################

