Refactoring Resource Factory