Changed .net framework version to 3.5
Some code cleanup