rewrote SymbolRegister with visitor pattern