remove unreachable

removed an unreachable line and simplified control flow.