Bringing in good changes from pipeline_refactor