Adding non-terminal types; refactors.