broken refactor for streams