Refactored js
Fixed setup