Cleaner code for the continue until ratio functionnality