Refactor saveEvent function into utilities file