JS refactoring
JS refactoring