rewriting classes