Refactored js and removed requirejs