some thread refactorings...
os specific directories added, direcory deletion on error while downloading