improve parsing efficiency
clean up unused code