Remove redundant HTML and change filetype