code optimization examples in c#