Minor re-factor to the python parser