Refactored EmpToUPCA