Changed factories to use associations