Pnotify & small refactoring