Updated to automatically handle different servers.