code cleanup in gafftools.py