Updated mediator module and added tests