better encoding, pretty print, html formatting