Rewriting the thtp module