initial pass to consolidate file transmission logic