pieview refactored