popover refactor