format streams properly