Removing code duplication
Fixes some weird code breakage seen when using relationships in Cmsed