Extract out the way to define associations