refactor, gradient