Move namequeries to single location