added canvas_utils; minor refactorings