Get rid of ternary operator