minor refactor to set the target-names of files in separate method