use streams properly