add more tests
simplify unreachable check