fixed bug where alarm rings when it is deleted, refactored code in AlarmUtility to improve legibility