clean/comment the code + add TShark exitcode check + directory handling improvements