refactor and update js packer