Rewrite locations