[notice email] improved code