   withMaps = (map and config.sourceMaps)
   mapPath = "#{path}.map"
 
-  optimize code, map, path, optimizers, config.optimize, (error, data) ->
+  optimize code, map, path, optimizers, (error, data) ->
     return callback error if error?
 
     if withMaps

      newMap = map
    next error, {data: optimizedCode, code: optimizedCode, map: newMap, path}

  optimizeFn.apply optimizer, optimizerArgs

optimize = (data, map, path, optimizers, isEnabled, callback) ->
  initial = {data, code: data, map, path}
  return callback null, initial unless isEnabled
  first = (next) -> next null, initial
  waterfall [first].concat(optimizers.map mapOptimizerChain), callback


  {data, code, map, path} = params
  debug "Optimizing '#{path}' with '#{optimizer.constructor.name}'"

  optimizerArgs = if optimizer.optimize.length is 2
    # New API: optimize({data, path, map}, callback)
    [params]
  else
