protected function loadModules(DirectoryIterator $files, array $config = [])
    {
        foreach ($files as $file) {
            $filename = $file->getFilename();
            if ($file->isDot() || $file->isDir() || $filename[0] == '.') {
                continue;
            } elseif ($file->isFile() && substr($filename, -4) != '.php') {
                continue;
            } else {
                try {
                    $this->load(substr($filename, 0, -4), $config);
                } catch (Exception $e) {
                    throw new RuntimeException(sprintf('Error while loading module : %s', $e->getMessage()));
                }
            }
        }
    }