add CanvasData class.
refactor.
apply event handlers.
add painter handler.