JS improvement