Improve readability by moving the continue operation into aseparate function.