Refactored the top panel into its own class.