track failures seperately from actual alerts sent
extract some magic strings/numbers
added some unit tests