Replaced regex with path methods for dynamic destPath