refactors mediator from service to factory to enable multiple pub/sub events per controller