refactoring ComputeError