Wrap previous socket loops into compact statement