refactor Query and var logger
Merge origin/master