canvas_events refactoring