refactoring: resource manager