refined and added emailer