Refactoring to add digit model