Query mediator got lot more smarter