Refactor the Dispatcher