Cleaned up popover code.