add mail notification, refactoring
refactoring