stream structure redesigned, TODOs added