little refactor + device plugin