Code cleaning for sg-example