Refactor for basic digits