Moved the device notification code