tidier use of GCD