refatcored generic foreign key