Split pipeline from mixins.go
savePipeline is abstracted out to private function.