Mediator migration: More cleanup and reorganization.