Resource manager
refactoring