Using min/max instead of ternary