Improve code in geometry classes