Simplify getDeviceType() with tests rewritten
device type pr fix