You don't need whole map as you check only "device" key.