1040 fix relations in models

should fix #1040 
Metrics/MethodLength: Method has too many lines. [14/10]