minor cleanup / improvements to parsing