Refactored pie