parser optimization and fix