Rework the main pipeline execution loop.