simplify the updateLocation procedure