public function extractModules($app)
    {
        if ($this->_modules === null) {
            foreach ($app->getModules() as $id => $obj) {
                // create module object
                $moduleObject = Yii::$app->getModule($id);
                // see if the module is a luya base module, otherwise ignore
                if ($moduleObject instanceof \luya\base\Module) {
                    $this->_modules[$id] = $moduleObject;
                }
            }
            // when no luya modules are registered an empty array will be returned.
            if ($this->_modules === null) {
                $this->_modules = [];
            }
        }
    }