Due to the lot of places where we used |this._activeApp| in this handleEvent function I would suggest to create a |var activeApp = this._activeApp;| before the switch and use it all over the place.