Remove duplication in Parser