Pipeline refactoring