remove unneeded/unreachable code