moved common function from xIAC.py to util.py