Improve locations handling