code optimizations for gesture based rotations