Update query to conform to new structure.