Refactor a parser