Factored command processor out of the canvas class