make zoom code more elegant