implemented mediator pattern