Split query tool and query toggle button into different components and make query tool a modal.