Improve Javascript