Refactor digitsMap