refactor zoomout to use functions instead of objects