added the mediator pattern