Collecting data from streams