refactor association building