Work on relations refactor