zooming/dragging code cleanup