Relations refactoring