Refine relationships between models.