clean up before refactoring
Escaping html entities in parser