Refactored out duplicate code in HTML and JSON Strategies