remove dead code and fix type of style and script tags