Refactored JS files