Index.js refactor

Refactoring index.js to be shorter, meaningful and more usable