Added escapeHtml() method
Refactored structured