add streaming interface and use it internally