move variables to be more local to code doing the work
move task import loop into separate function, such that csvreader is parameterisable