Refactor relationships with links