replace weird boolean logic with ternary