refactoring for resources
refactoring for resources