private function registerModelsAndTwigLayoutNamespaces ($baseDir)
    {
        $elementTypesModel = new ElementTypesModel($baseDir);

        // model
        $this["model.element_types"] = $elementTypesModel;
        $this["model.download"]      = new DownloadModel($baseDir);

        // twig template namespaces
        foreach ($elementTypesModel->getAllElementTypes() as $elementType)
        {
            $this["twig.loader.filesystem"]->addPath($elementTypesModel->getUserSubDirectory("{$elementType}s"), $elementType);
        }


        $this["twig.loader.filesystem"]->addPath($elementTypesModel->getUserSubDirectory("_base"), "base");
    }