Refactored the Query package structure