Merge with geometry refactoring

Authored by felixir.