javascript classes (mediator)