Factory gcd