Refactoring + resource model creation