Refactor Panels.toggle()