Move notification code to external script