cleaning up video stream code