Separated index.js file into three files