started working on stream refactoring