Extracts json construction logic from template into the EventHelper.