Move insert rows to alone function.