mediator code cleanup