remove unnecessary if statements