Refactor renderer
Refactor index.js