restructuring log and dir