refactored pan/zoom, click events