refactored event create model code into the model