Script refactoring & addition of url file builder