Streaming implemented. Some design changes