Refactoring, discrete logarithm problem