Before context rewrite