Do some cleaning. Add gradient-related APIs.