lots of parser cleanup