[PATCH 3/6] Refactor the notification script