Refactor code with user geolocation and place search functionality