v2 rewrite