some refactoring to allow working both locally and from the drive