cleaning up parser code