error refactorings