private function buildBlockTypes(ContainerBuilder $container, array $blockTypes): Generator
    {
        foreach ($blockTypes as $identifier => $blockType) {
            $serviceIdentifier = sprintf('netgen_block_manager.block.block_type.%s', $identifier);

            $container->register($serviceIdentifier, BlockType::class)
                ->setArguments(
                    [
                        $identifier,
                        $blockType,
                        new Reference(
                            sprintf(
                                'netgen_block_manager.block.block_definition.%s',
                                $blockType['definition_identifier']
                            )
                        ),
                    ]
                )
                ->setLazy(true)
                ->setPublic(true)
                ->setFactory([BlockTypeFactory::class, 'buildBlockType']);

            yield $identifier => new Reference($serviceIdentifier);
        }
    }