remove redundant layer of error handling
tidy up error handling
move d/l dir creator into lib