formalized TERMINAL class