Change typo in index
Refactor js