Rewrite to PiVT v2