rewrite some stuff with TW & TP.