Improve logic to update availabilities.