     actors[type] = actor
 
 withAdapter = (type, adapter) ->
-  if not type then throw new Error "Adapter's type undefined"
-  if not adapter then throw new Error "Adapter undefined"
+  throw new Error "Adapter's type undefined" if not type
+  throw new Error "Adapter undefined" if not adapter
   if adapters[type]
     logger.warn "Adapter '#{type}' already defined"
   else

  files = fs.readdirSync path
  files.forEach (file) ->
    # TODO Recursive file loading 
    if (file.indexOf ".coffee" isnt -1) and (fs.statSync("#{path}/#{file}").isFile())
      callback file.substr(0, pos), "#{path}/#{file}"  

loadActors = () ->
  builtinActorsName.forEach(name) -> 
    require "./actor/#{name}"
  loadDirectory "#{process.cwd()}/actors", withActor  

loadAdapters = () -> 
  builtinAdaptersName.forEach(name) -> 
    require "./adapters/#{name}"
  loadDirectory "#{process.cwd()}/adapters", withAdapter


loadAdapters
loadActors


exports.withActor = withActor

newAdapter = (type, properties) ->
  # Controls and warning about builtinAdapters override
  throw new Error "Adapter's type undefined" if not type
  if not adapters[type]
    adapters[type] = require type
  else if typeof adapters[type] is "string" 
    adapters[type] = require adapters[type]
