improve code example for stream