Added handling for for the AppDomains here the ServiceClients run; code cleanup