refactor get Query call