Changing callbacks to events