replace to-stream with unify-stream