protected function getUrlInstanceFromConfig(
        $urlConfig,
        array $defaultHTTPCodes,
        array $defaultOptions,
        array $profiles
    ) {
        $url = $this->getUrlPathFromConfig($urlConfig);

        $urlHTTPCodes = $this->getUrlHTTPCodesFromConfig(
            $urlConfig,
            $defaultHTTPCodes
        );

        $urlOptions = $this->getUrlOptionsFromConfig(
            $urlConfig,
            $defaultOptions
        );

        if (
            isset($urlOptions['profile']) &&
            isset($profiles[$urlOptions['profile']]) &&
            is_array($profiles[$urlOptions['profile']])
        ) {
            $urlOptions = array_merge(
                $profiles[$urlOptions['profile']],
                $urlOptions
            );
        }

        return $this
            ->urlFactory
            ->create(
                $url,
                $urlHTTPCodes,
                $urlOptions
            );
    }