Refine gcd word used in test suite with more elegant solution.