reformatted popup.html to be better object orientation