Rewrite ids