--- a/qeilin/modelconfig.cpp
+++ b/qeilin/modelconfig.cpp
@@ -23,41 +23,9 @@
 
 ModelConfig::ModelConfig(libusb_device *device, QWidget * parent, Qt::WindowFlags f) : QDialog(parent, f)
 {
-    // get the descriptor
-    libusb_device_handle *handle;
-    if (libusb_open(device, &handle)) {
-        throw std::runtime_error("Can't open the device");
-    }
-
-    int reattach_driver = 0;
-    if (libusb_kernel_driver_active(handle, 0x0)) {
-        reattach_driver = 1;
-        if (libusb_detach_kernel_driver(handle, 0x0)) {
-            libusb_close(handle);
-            free(device);
-            throw std::runtime_error("Can't detach kernel driver");
-        }
-    }
-    int foo = libusb_claim_interface(handle, 0x0);
-    if (libusb_claim_interface(handle, 0x0)) {
-        libusb_close(handle);
-        throw std::runtime_error("Can't claim interface");
-    }
-    if (reattach_driver) {
-        libusb_attach_kernel_driver(handle, 0x0);
-    }
-
-    unsigned char data[2048];
-    int len = libusb_control_transfer(handle, 0x81, 0x06, 0x22 << 8, 0, data, 2048, 1000);
-
-    libusb_release_interface(handle, 0x0);
-
-    if (len <= 0) {
-        libusb_close(handle);
-        throw std::runtime_error("Can't get device descriptor");
-    }
-    QByteArray descriptor(reinterpret_cast<const char*>(data), len);
-    m_descriptorHexStr = QString(descriptor.toHex());
+    char *descriptor = eilin_getDeviceDescriptor(device);
+    m_descriptorHexStr = QString(descriptor);
+    free(descriptor);
 
     // prepare UI
     setupUi(this);