geometry refactoring