scripts: refactored code to adapt to new Path features.