Get rid of legacy dispatcher.

Update  #852 to not use legacy_dispatcher.