remove duplicate code
new geometry API