Externalize levenshtein and event handling helper.