Geofencing refactoring