smallish refactor of pipeline
smallish refactor of pipeline