refactoring mail templates