TerminalSymbol refactoring