This is out of place. Sanitization of the `resource.resourcePath` should be done while building the resource object, not when adding models to it.