Refactored nested associations so they are more readable. Added comments
which make it clearer about what's going on.
Merge pull request #9614 from wangjohn/refactoring_nested_associations_for_readability

Refactored nested associations so they are more readable.