Refactor associations definition spec