First stab at refactoring of relations