Example: Pipelining - refactor the pipelining code