Refactored pane management into its own class