- refactoring in Query class
- fix the unit tests