Simplified by using pattern

Used pattern: 
while () {
    do x;
}
do x one more time;