Cleanup.
Helper to generate json from html.