public PipelineBeforeOptimization(IBuilder builder, ReadOnlySettings settings,
                                          PipelineModifications pipelineModifications)
        {
            var coordinator = new StepRegistrationsCoordinator(pipelineModifications.Removals,
                                                               pipelineModifications.Replacements);

            foreach (var rego in pipelineModifications.Additions.Where(x => x.IsEnabled(settings)))
            {
                coordinator.Register(rego);
            }

            behaviors = coordinator.BuildPipelineModelFor <TContext>()
                        .Select(r => r.CreateBehaviorOld(builder)).ToArray();
        }
        public PipelineAfterOptimizations(IBuilder builder, ReadOnlySettings settings,
                                          PipelineModifications pipelineModifications)
        {
            var coordinator = new StepRegistrationsCoordinator(pipelineModifications.Removals,
                                                               pipelineModifications.Replacements);

            foreach (var rego in pipelineModifications.Additions.Where(x => x.IsEnabled(settings)))
            {
                coordinator.Register(rego);
            }

            // Important to keep a reference
            behaviors = coordinator.BuildPipelineModelFor <TContext>()
                        .Select(r => r.CreateBehaviorNew(builder)).ToArray();

            pipeline = behaviors.CreatePipelineExecutionFuncFor <TContext>();
        }