-- upgraded to .NET 4.0
-- some minor code refactoring.