lots of cleanup in parser.