resource.ResourceFacrory refactored