cleanup and more on c# sample