Refactor the input number validation. Extract repeated code in the practice service into a common method, add the repeat tag filter.