Added a callback function for the directories cleaned up some additional pieces