use a common function for loading popovers