Polygon refactoring