Restructured i2c class