Stream class - adding flow control and structural changes.