some ternary operator removal