Replace ternary operator by if statement.