Using ternary operator instead of short if/else