Changed callbacks to events