Cleaning up the event script.