Started refactory out to popup