error variable  refactoring