Refactor associations into separate factory.