Feature/js refactoring