implement stream model and controller