Refactor gcd player