Remove JS for loop