Javascript and HTML improvements