refactoring mediator