Reworked to stream class