rewrite controllers