Organized code in main.js and phones-main.js