Neaten code and add some Tools.escapeHTML's