migration to the proper markup, cleanup, mail sending