Refactoring in order to support .NET framework 4.0