private function setupRegisteredModules($modules, $paths)
    {
        if (empty($modules) || empty($paths)) {
            throw new Exception\InvalidArgumentException('Invalid parameters for init phalcon extesion');
        }
        foreach ($modules as $moduleName) {
            $found = false;
            foreach ($paths as $path) {
                $modulePath = $path . DIRECTORY_SEPARATOR . $moduleName . DIRECTORY_SEPARATOR . 'Module.php';
                if (file_exists($modulePath)) {
                    $found = true;

                    $this->modules[$moduleName] = [
                        'className' => $moduleName . '\\Module',
                        'path'      => $modulePath,
                    ];
                    break;
                }
            }
            if (!$found) {
                throw new Exception\RuntimeException(sprintf('Not found module "%s"', $moduleName));
            }
        }
    }