refactor index.js
refactor bundle to lib