sendgrid is working again! also tidied up a bit