refactoring get Gradient