Moving repetitive dispatch code to a method.