specify a source of gems
renamed the local variable to something intent revealing
moved the variable out of the if block
split the ternary if-else, create elsif block for complentary condition
extracted an advantage method
extracted win query method