gcd: improvements