- refactoring js