Refactoring on polygon classes