Refactoring - moving key event handlers out of canvas object