command and mediator pattern added