Continue replacing breaks with while conditions