twi: Rewrite entirely.