refactored setlocation code, refresh on settings change