Refactoring desktop notifications