refactoring index.js and index.css