Refactored pipeline