Refactored to index.js.