REF: clean up parser code