move cleanup_unread() and send_email() to their own branch