Clean up the Json code a bit.