ResourceContext refactoring