Refactored figure class