Refactored i2C library