tc.c: clean-up code