Group streams into substreams