Start reimplementing the query functionality using the new normalization logic