Refactor piping