Moved heca related code to heca.py