refactor private methods, add geolocation, fix some errors