   # in order of `before:` and `after:`
 
   for moduleName in _sortedRoutes
-
     # if we deal with express instance method
     # we create a new express / app instance for each module
     if mountToApp
       app = instanceMethod()
-      for settingKey of options.expressjsSettings
-        app.set(settingKey, options.expressjsSettings[settingKey])
+      for settingKey of options.expressjs?.set
+        app.set(settingKey, options.expressjs.set[settingKey])
 
     routes = modules[moduleName].routes.routes
     codeFiles = {}

  return @log.error('instanceMethod argument needs to be a function') if typeof instanceMethod isnt 'function'
  exports.buildModuleIndex()
  app = exports._applyOnInstanceMethod(instanceMethod)
  app.locals.config = @getConfig() if _options.configOnLocals
  return app

exports.log = {

  basedir: null # with `null` => process.cwd()
  configOnLocals: true
  defaultMountpoint: '/' # is able to contain a $module variable, e.g. '/$module'
  localConfigKey: 'config'
  expressjs:
    set:
      'view engine': 'jade'
}

_options = {}
