       factory
   
   loadModule = (name, type) ->
-    if hasModule and typeof udefine[type][name] is 'string'
+    if hasModule and typeof udefine.modules[type][name] is 'string'
       path = require 'path'
       prePath = do ->
         if udefine.paths[type].base
           udefine.paths[type].base
         else
           ''
-      require path.join(process.cwd(), prePath, udefine[type][name])
+      require path.join(process.cwd(), prePath, udefine.modules[type][name])
     else
-      udefine[type][name]
+      udefine.modules[type][name]
   
   # Main entry point
   udefine = (name, deps, factory) ->

      depArr = (loadModule(dep, platform) for dep in deps)
      
      result = resolveModule factory, depArr
      module.exports = result if hasModule
      
      # Set dependency if it does not exist

        
    # Inject result into defined namespace
    if Object.hasOwnProperty.call udefine.inject.modules, name
      injectObject = udefine.inject.modules[name]
      
      {root: injectRoot, name: injectName, exportable} = injectObject
      
      udefine.inject(injectRoot, injectName)(result)
      
      if hasModule
        if exportable or exportable is 'all' then module.exports = result
        if exportable is 'partial' then exports[injectName] = result
        
    result
  
