Restructuing the way copy_file works