Replace ternary operations with if statements