Grouped both the IFs to remove redundat statements
for help.