Merge with Naimish's changes, plus addition of mediator related classes