Refactored the notification display section

Should behave the same as before with a few less assignments to the tooltip variable and no duplicated HTML code.

PS: I see no `dev` branch as mentioned in the CONTRIBUTING file so I created it against the `master` branch