Refactoring the code in ic

I have implemented a base class with reference to the pin numbers and have tried to structure it.