Refactored DemographicsQuery a bit