Refactor some and send report out by email