Code cleaning for sp-example