using streams properly