issue #22244: refactor document associations

resolves #1962.