Extract parsing & printing of digits
Move the digit extraction out to its own file
Split behavior between reader & writer