Refactored js files