reorganize app to broadcast login/logout events and handle on an application level