Would it make sense to change this function so that a sourcePath and targetPath can be passed in? That will avoid us having to do unlinks in the various places this is being used.