private function renderFieldSets(
        Action $action,
        \ArrayObject $renderInformation,
        PropertyValueBagInterface $propertyValues = null,
        EnvironmentInterface $environment
    ) {
        $properties = $this->getOverrideProperties($action, $environment);
        $model      = $this->getIntersectionModel($action, $environment);

        $widgetManager = new ContaoWidgetManager($environment, $model);

        $errors   = [];
        $fieldSet = ['palette' => '', 'class' => 'tl_box'];

        $propertyNames = $propertyValues ? \array_keys($propertyValues->getArrayCopy()) : \array_keys($properties);

        foreach ($propertyNames as $propertyName) {
            $errors = $this->getPropertyValueErrors($propertyValues, $propertyName, $errors);

            if (false === \array_key_exists($propertyName, $properties)) {
                continue;
            }

            $property = $properties[$propertyName];

            $this->setDefaultValue($model, $propertyValues, $propertyName, $environment);

            $widget = $widgetManager->getWidget($property->getName(), $propertyValues);

            $widgetModel = $this->getModelFromWidget($widget);

            if (!$this->ensurePropertyVisibleInModel($action, $property->getName(), $widgetModel, $environment)) {
                $fieldSet['palette'] .=
                    $this->injectSelectParentPropertyInformation($action, $property, $widgetModel, $environment);

                continue;
            }

            if ($extra = $property->getExtra()) {
                foreach (['tl_class'] as $extraName) {
                    unset($extra[$extraName]);
                }

                $property->setExtra($extra);
            }

            $fieldSet['palette'] .= $widgetManager->renderWidget($property->getName(), false, $propertyValues);

            $fieldSet['palette'] .= $this->injectSelectSubPropertiesInformation(
                $property,
                $widgetModel,
                $propertyValues,
                $environment
            );
        }

        if (empty($fieldSet['palette'])) {
            $fieldSet['palette'] = \sprintf(
                '<p>&nbsp;</p><strong>%s</strong><p>&nbsp;</p>',
                $environment->getTranslator()->translate('MSC.no_properties_available')
            );
        }

        $renderInformation->offsetSet('fieldsets', [$fieldSet]);
        $renderInformation->offsetSet('error', $errors);
    }