Refactor I2CDevice.