Making Rewrite pluggable