refactor dbloader to accept array of data to insert