Extract commands and command routing to separate classes