Rewriting DumBot to a more functional style.