Improve user location logic