protected function setBlockResolvedOptions($id, $blockType, $options, $types)
    {
        // resolve options
        $resolvedOptions = new Options($this->optionsResolver->resolveOptions($blockType, $options));

        $this->processExpressions($resolvedOptions);
        $resolvedOptions = $this->resolveValueBags($resolvedOptions);

        if ($resolvedOptions->get('visible', false) !== false) {
            // point the block builder state to the current block
            $this->blockBuilder->initialize($id);
            // iterate from parent to current
            foreach ($types as $type) {
                $type->buildBlock($this->blockBuilder, $resolvedOptions);
                $this->registry->buildBlock($type->getName(), $this->blockBuilder, $resolvedOptions);
            }
            $this->rawLayout->setProperty($id, RawLayout::RESOLVED_OPTIONS, $resolvedOptions);
        } else {
            $this->rawLayout->remove($id);
        }

        return $resolvedOptions;
    }