Refactored the popovers to a separate class. Cleaned up the code.