refactor Digits