Refactor driver name parsing code.