protected function processDefinitions(array $definitions)
    {
        foreach ($definitions['subdivisions'] as $code => &$definition) {
            // Add common keys from the root level.
            $definition['country_code'] = $definitions['country_code'];
            if (isset($definitions['locale'])) {
                $definition['locale'] = $definitions['locale'];
            }
            // Ensure the presence of code and name.
            $definition['code'] = $code;
            if (!isset($definition['name'])) {
                $definition['name'] = $code;
            }
            if (isset($definition['local_code']) && !isset($definition['local_name'])) {
                $definition['local_name'] = $definition['local_code'];
            }
        }

        return $definitions;
    }