Generalizing/Refactoring Pie Chart & Work Model code