[DF-5253] Code refactor and commentaries. Fixed empty files downloading and retrying download of fully downloaded files.