Move the composeFileToTarget function