[DF-5024] Native determination download range for Curl dwonload parts. Small code refactor to make it better readable. Some codestyle fixes. Error handling.