Move all code on the popup.js