refactors CTRL-W functionality for all panels individually