Refactor with DeviceStateValue.