refactored table-pie