Better emit-stream rewrite