Reorganize code to get Geolocation working properly