refactor, add js