重构ResourceManager