code cleanup, now it is working with IIC