changed model attributes and associations logic