Move function call to convert to JSON.