rewrite setup