refactor find-digits