Moving init login into init.js file