Refactor code in updateNotifications().
Refactor code in updateUI() for consistency.