Move the dispatcher to a separate file.