refactoring xIAC.py