Refactor strategy pattern in Levenshtein