improve code quality, document index.js