Clean up some logic with intervals in alerts