Partial rewrite, sorting, verifications, refinements