relations types refactoring; relations generation redesigned