improvements to parsing