generalize stream