further refinements to parser