refactoring and first expected exception works