refactor stream interfaces for less repetition