Added notifications to the PW app plus some code refactoring

no screaming please.