make function indexing replacements JSON-friendly