Refactoring

Use Enumerable#min_by to find the best match.