general parser code clean up