Remove unneeded nested if