Refactor reversing of digits
WIP