refactoring to support using Stream.device_instance as its stream ID