Updated relationsFactory to use resource