Refactored code C# Console, IIS, SL, WP7