Moved certain code to classes and implemented creating a new event