Rewrite of models