optimize
if -> ternary operator