reduce if statements