Refactoring to further separate base code from mailout code