ResourceManager refactoring to be simpler