using expected-err as an arg and removed unnecessary do's