Reworking the device detection methods