slightly improve GCD routine.