rewrite parser to make it fast
cleanup