private function removeInvariantAttributes(IItem $nativeItem, ICollection $renderSetting)
    {
        $model = $nativeItem->getMetaModel();

        if ($model->hasVariants() && !$nativeItem->isVariantBase()) {
            // Create a clone to have a separate copy of the object as we are going to manipulate it here.
            $renderSetting = clone $renderSetting;

            // Loop over all attributes and remove those from rendering that are not desired.
            foreach (array_keys($model->getInVariantAttributes()) as $strAttrName) {
                $renderSetting->setSetting($strAttrName, null);
            }
        }

        return $renderSetting;
    }