Refactoring: Moved all notification code out of temp working file