refactoring user notification emailing