refactor if statements to ternaries