refactor relationships