Refactoring: No functional change

Moved some code from runPipeline' into runPipeline.
dynamic-too progress