WiP refactoring the pipeline