       @[k] = v
 
   @addModules: (map) ->
-    @modules = [] unless @hasOwnProperty "modules"
-    if @hasOwnProperty "moduleNames"
-      console.log("NeptuneNamespaces: alread have moduleNames for #{@getName()}")
-    else
-      console.log("NeptuneNamespaces: create moduleNames for #{@getName()}")
-      @moduleNames = []
 
     for name, module of map
       @moduleNames.push name
       @modules.push module
-      @_setChildNamespace name, module
+      @_setChildNamespaceProps name, module
       @[name] = module unless name.match /^-/
     @
 

  @package: _package = require "../package.json"
  @version: _package.version

console.log "neptune-namespaces global defined: self.Neptune"

      # legacy support
      namespace = name
      name = namespace.name
    @_setChildNamespaceProps name, namespace
    @allNamespaces[@namespacePath] = namespace.initAsSubNamespace name, @
    namespace

  @_setChildNamespaceProps: (name, child) ->
    if typeof child == "function" && name.match /^[A-Z]/
      child.namespace = @
      child.namespacePath = @namespacePath + "." + name

