1040 fix relations in models

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