Small refactor of byte-stream