Tidy up Device::query