Tidying up the HTML semantics