Refactor the js & update the package