refactored geometry dimension check