Refined i2c communication logic