refactored email/local file content generation to common components