Improve geometry conversion functions