extract to "copy to tmp folder" method. DRY