Refactor the parser classes