Fix issues with generating interface code
Start to refactor the class generation