refactor exception tests