Rewrite Gamma as Factorial #8621

Code quality improved for pull 8700