Refactored digit reader