Simplify if statements for clarity

use if/else if to improve logic clarity