rewrite on pipes