Fill in TODO more. Refactor more dispatch functions to have a do_ counterpart.