Added notifications to the PW app plus some code refactoring