use streams more effectively