Sgd cleanup