Code cleanup and prepared packages for later
Moved more of the query settings to the VM