Major upgrades to handling of associations