several TP related cleanups from @jikuja