refactor stream to better handle partial utf8