better geometry handling