Remove unreachable code and an unused switch