Refactored JS
Refactored JS