Modified JS and HTML generation