Legitimate removal of non-digits from the input
Functionally complete solution
Extract non-digit cleaning
Extract the trim function
Make parameters more consistent
Improve function names