Moved logic for determining the link based on fields priority into model itself