Refactor package.js