refactor gtdParser.py