Improve set/reset location
Move location logic to model
Merge remote-tracking branch 'origin/fix_set_reset_of_location'