slightly better approach for clearing a pane