using ast-types, instead of explicit checks
more tolerant parser