extGIA: Queries refactoring