public function registerTypesAndConfig(ConfigurationService $config)
    {
        $services = $this->container->getServiceIds();
        foreach ($services as $service) {
            if (substr($service, 0, 14) == "midnight_type.") {
                if (!$config->has("type", $service)) {
                    $this->container->get($service)->initialize();
                    $config->set("type", $service, $this->container->get($service)->getCacheLevel());
                }
            } elseif (substr($service, 0, 16) == "midnight_config.") {
                $serv = $this->container->get($service);
                $c = $serv->getConfiguration();
                foreach ($c as $key => $data) {
                    if (!$config->has("configuration", $key)) {
                        $config->set("configuration", $key, $data["default"]);
                    }
                }
                $toolbar = $serv->addToolbar($this->container->get("router"));
                foreach($toolbar as $name => $path){
                    if (!$config->has("toolbar", $name)) {
                        $config->set("toolbar", $name, $path);
                    }
                }
                $templates = $serv->registerTemplate();
                foreach($templates as $name => $template){
                    if (!$config->has("template", $template)) {
                        $config->set("template", $name, $template);
                    }
                }

            }
        }
    }