Small stream refactoring