remove useless tags. close some tags. format output. generate valid html