Refactor Pipes into a single type