Refactored to remove duplicates - separated JSON from XML converters