pipeline_B executed on_end pipelineA, the code needs refactoring