cleaned up the geolocation related functions.