Refactor popup create/delete code
Add close button to popup