Refactored association handling, now based on listeners.