rewrite resource manager