relationships refactor