Improve use of JS