small refactoring of popovers