public function createContainer(): Factory
    {
        // First set all the directories
        Core::$appDir = $this->parameters['appDir'];
        Core::$wwwDir = $this->parameters['wwwDir'];
        Core::$tempDir = $this->parameters['tempDir'];
        Core::$logDir = $this->parameters['logDir'];

        // Then set debug mode
        if ($this->parameters['debugMode'])
        {
            define('ENVIRONMENT', 'DEVELOPMENT');
        }
        else
        {
            define('ENVIRONMENT', 'PRODUCTION');
        }

        // And enable Tracy Debugger 
        if (class_exists('Tracy\Debugger', true))
        {
            Debugger::enable(!$this->parameters['debugMode'], realpath($this->parameters['logDir']));
            if (isset($this->parameters['debugEmail']))
            {
                Debugger::$email = $this->parameters['debugEmail'];
            }
            Logger::$useTracy = true;
        }

        // Then load the framework
        Core::init();

        return Factory::getInstance();
    }