refactor the streaming handling
fix tests: streaming is not only for batches