fix pagination style
modularize index.js