added some cleanup support methods and impl to MultiLayerGradient