refactoring code inside of parseAssociation