rewrite streams