move a lot of logic from apply to constructor
pull in association class into entity itself