Moved code from blog into wcf