cleaning up semantic tree builder and nonterminal node base