native js optimisation