restructure to mailnotify