Add handling for local file system repository urls
Refactoring to clean up code