reduce time between get_output_file call and with-block