Refactoring the resource parsing logic into a separate model