Extracting common code into relationship support