Rewriting resource management