cleaning query files