Added notifications to the PW app plus some code refactoring

Avoid inline comments or at least include a space.