Move the logic into the dispatch method.