refactors repair geometries queries