Threading to remove expired alerts, other improvements