more cleanup to parser code