add html escaping and refine