Better way to architect this function?
I have a function that consists mainly of a massive amount of calls (50+) to another function which inserts data into a table, with logic here and there dictating various conditions to insert various items into the table (plus a little bit on the end that writes the contents of the table out to a file). I'm wondering if there isn't a better way to make this function; I suppose i could start with logically splitting table insertion command sets into their own functions, but I'm wondering if there's any more I can do. Is there?
Better way to architect this function?
===

I have a function that consists mainly of a massive amount of calls (50+) to another function which inserts data into a table, with logic here and there dictating various conditions to insert various items into the table (plus a little bit on the end that writes the contents of the table out to a file). I'm wondering if there isn't a better way to make this function; I suppose i could start with logically splitting table insertion command sets into their own functions, but I'm wondering if there's any more I can do. Is there?