refactoring errorhandling