Extract alert boxes to a helper