Resource Context refactoring