Add default button for query window
Refactor and documentation
Minor fixes
Minor fixes