Consider extracting method (insertRows()?) for reuse and to make the intent clearer.