Restructred and removed C#