Optimized the JS for the testpage.