refactor: pull some cases out of tc, and tc vars like lets
reorganization and dead code elimination speeds up by factor of 2