Moved QueryServiceConfig() to a separate function.