recode relation between models