Refactoring: separate js files