More abstraction and fixes for relationships