protected function prepareInfo($module_id, array $info, array $installed)
    {
        $info['directory'] = $this->getDirectory($module_id);

        $info += array(
            'type' => 'module',
            'name' => $module_id,
            'version' => null
        );

        // Do not override status set in module.json for locked modules
        if (isset($info['status']) && !empty($info['lock'])) {
            unset($installed[$module_id]['status']);
        }

        if ($info['version'] === 'core') {
            $info['version'] = GC_VERSION;
        }

        if (!empty($info['dependencies'])) {
            foreach ((array) $info['dependencies'] as $dependency_module_id => $dependency_version) {
                if ($dependency_version === 'core') {
                    $info['dependencies'][$dependency_module_id] = GC_VERSION;
                }
            }
        }

        // Do not override weight set in module.json for locked modules
        if (isset($info['weight']) && !empty($info['lock'])) {
            unset($installed[$module_id]['weight']);
        }

        if (isset($installed[$module_id])) {

            $info['installed'] = true;

            if (empty($installed[$module_id]['settings'])) {
                unset($installed[$module_id]['settings']);
            }

            $info = array_replace($info, $installed[$module_id]);
        }

        if (!empty($info['status'])) {

            try {
                $instance = $this->getInstance($module_id);
                $info['hooks'] = $this->getHooks($instance);
                $info['class'] = get_class($instance);
            } catch (Exception $exc) {
                return $info;
            }
        }

        return $info;
    }