Code refactor and Upgrade to .NET 4.5.2