Simplify getDeviceType() with tests rewritten