some minor clean up to parser