Improved notification handler