gradient mixing refactored and renamed