DRYing out the code, moved Directory and File related activities to own module.