refactoring IC.cup and more