Remove use of a deferred object and strictly use events