html prettification and other improvements
Don't need to do this twice