rewrite parsing functions