cleanup: const-ify a few queries