Removed code duplication between ParseOperation and ParseTerm