Move most dispatching into separate files for ease of maintainership.