Refactor parser tests